/* eslint-disable no-unused-vars */
/* eslint-disable react-hooks/rules-of-hooks */
import React, { useState } from "react";
import styles from "./css/home.module.css";
import { ResultPage, Card, Checkbox, Button, Segmented, Tabs } from "antd-mobile";
import { LoopOutline } from "antd-mobile-icons";
import dayjs from "dayjs";
import { useNavigate } from "react-router-dom";
function index() {
    let nav=useNavigate()
    const [info,setInfo]=useState({
        start:'北京',
        end:'厦门',
        date:dayjs().format("YYYY-MM-DD"),
        isSpeed:false
    })
  return (
    <div>
      <ResultPage
        status=""
        title=""
        description=""
      >
        <ResultPage.Card style={{ padding: 8 }}>
            <Segmented  options={['机票', '国内火车', '国际/港台', '汽车票']} />
            <Tabs>
          <Tabs.Tab title='单程' key='fruits'>
            <div className={styles.row1}>
            <span>{info.start}</span>
            <LoopOutline fontSize={26} />
            <span>{info.end}</span>
          </div>
          <div className={styles.row1}>
            <span>{info.date}</span>
          </div>
          <div className={styles.row1}>
            <div>
              <span>学生票</span>
              <Checkbox />
            </div>
            <div>
              <span>高铁动车</span>
              <Checkbox />
            </div>
          </div>
          <div className={styles.row1}>
            <Button block color="warning" size="large"
            onClick={()=>nav(`/list?start=${info.start}&end=${info.end}&date=${info.date}&isSpeed=${info.isSpeed}`)}
            >
              查询
            </Button>
          </div>
          </Tabs.Tab>
          <Tabs.Tab title='往返' key='vegetables'>
            无车票
          </Tabs.Tab>
         
        </Tabs>
          
        </ResultPage.Card>
      </ResultPage>
    </div>
  );
}

export default index;
